<?php

class Damages_Methods_Response_GetUsers extends Damages_Methods_Response {

  /**
   *
   * @var Damages_Methods_Data_User_Detailed[] 
   */
  public $users = array();

  public function setUsers() {
    $data = DamagesUsersQuery::create()
            ->joinPermissions(null, Criteria::LEFT_JOIN)
            ->useUserDealersQuery(null, Criteria::LEFT_JOIN)
            ->useDealersQuery(null, Criteria::LEFT_JOIN)
            ->joinDictBrands(null, Criteria::LEFT_JOIN)
            ->endUse()
            ->endUse()
            ->with('Permissions')
            ->with('UserDealers')
            ->with('Dealers')
            ->with('DictBrands')
            ->find();
    foreach ($data as $user) {
      $this->users[] = new Damages_Methods_Data_User_Detailed($user);
    }
  }

}